<?php
/**
 * Enter description here...
 *
 * @package if
 * @subpackage module.helper.controllers
 * @since 1.0
 */
class IfHelperControllerController extends IHelperController {
	function doIndex() {
		$file = xn("file");
		$this->contents = file_get_contents($file);

		if ($this->request()->isPost()) {
			$source = rtrim(xn("source"));
			$this->contents = $source;
			file_put_contents($file, $source);
			if (x("save_and_refresh")) {
				echo "<script>window.parent.location.reload();</script>";
				return 1;
			}
		}
	}
}

?>